<?php
namespace Admin\Controller;
use Common\Controller\AuthController;
use Think\Controller;
class ContactController extends AuthController {

    public function index(){
        if(IS_POST){
            $data=I();
            $data['updata_time']=time();
            $result=M('contact')->where(array('id'=>1))->save($data);
            if($result){
                $this->success('修改成功');
            }else{
                $this->error('修改失败');
            }
        }else{
            $result=M('contact')->where(array('id'=>1))->find();
            $this->assign('result',$result);
            $this->display();
        }
    }
}